<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <button @click="count--">--</button>
        <h1>{{ count }}</h1>
        <button @click="count++">++</button>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                count: 100
            },
            // 创建
            beforeCreate() {
                console.log('beforeCreate组件创建之前');
            },
            created() {
                console.log('created组件创建');
            },
            // 挂载
            beforeMount() {
                console.log('beforeMount组件挂载之前');
            },
            mounted() {
                console.log('mounted组件挂载');
            },
            // 更新
            beforeUpdate() {
                console.log('beforeUpdate组件更新之前');
            },
            updated() {
                console.log('updated组件更新');
            },
            // 销毁
            beforeDestroy() {
                console.log('beforeDestroy组件销毁之前');
            },
            destroyed() {
                console.log('destroyed组件销毁');
            }
        });
    </script>
</body>

</html>